#include<stdio.h>

int main(void)
{ 
     int arr[] = {4,5,1,6,8,2,7,9};
     int max = arr[0], min = arr[0];
     for (int i = 1; i < sizeof(arr) / sizeof(*arr); i++)
     {
          if (arr[i] > max)
               max = arr[i];
          else if (arr[i] < min)
               min = arr[i];
     }
     printf("max = %d,min = %d\n",max,min);
     return 0;
}
